package com.freesun.shop.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.freesun.shop.entity.SysLog;
import com.freesun.shop.service.SysLogService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys/log")
public class SysLogController {

    //改变
    @Autowired
    private SysLogService sysLogService;
    @ApiOperation("系统日志的查询")
    @GetMapping("/page")
    @RequiresPermissions("sys:log:page")
    public ResponseEntity<IPage<SysLog>> page(SysLog sysLog, Page<SysLog> page){
        IPage<SysLog> iPage= sysLogService.findByPage(sysLog,page);
       return ResponseEntity.ok(iPage);
    }
}
